package com.mydemo.springlearning;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@SpringBootApplication
@ServletComponentScan
@EnableCaching
@EnableSwagger2
@MapperScan({
        "com.mydemo.springlearning.functions.CRUDdemo.byxml.mapper",
        "com.mydemo.springlearning.functions.CRUDdemo.byannotation.mapper" ,
        "com.mydemo.springlearning.functions.memoryshare.mapper"
})
public class StarterApplication {

    public static void main(String[] args) {

        ConfigurableApplicationContext applicationContext = SpringApplication.run(StarterApplication.class, args);
        System.out.println("--->>>启动完毕！");
        String userName = applicationContext.getEnvironment().getProperty("base.config.companyId");
        String userAge = applicationContext.getEnvironment().getProperty("user.age");
        String confValue = applicationContext.getEnvironment().getProperty("conf.value");
        System.err.println("user name :"+userName+"; age: "+userAge+"; confValue:"+confValue);
    }

}
